home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / VISUALBA / VBTRANS.ZIP / TRANSP.FRM < prev    next >
Text File  |  1993-08-17  |  4KB  |  125 lines

  1. VERSION 2.00
  2. Begin Form wndEarth 
  3.    Caption         =   "Take a trip in a 747 to see the world"
  4.    ClientHeight    =   4020
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1485
  7.    ClientWidth     =   7365
  8.    Height          =   4425
  9.    Left            =   1035
  10.    LinkTopic       =   "Form1"
  11.    Picture         =   TRANSP.FRX:0000
  12.    ScaleHeight     =   268
  13.    ScaleMode       =   3  'Pixel
  14.    ScaleWidth      =   491
  15.    Top             =   1140
  16.    Width           =   7485
  17.    Begin PictureBox picAngel 
  18.       AutoSize        =   -1  'True
  19.       Height          =   3750
  20.       Left            =   1080
  21.       Picture         =   TRANSP.FRX:165BA
  22.       ScaleHeight     =   3720
  23.       ScaleWidth      =   1785
  24.       TabIndex        =   3
  25.       Top             =   3000
  26.       Visible         =   0   'False
  27.       Width           =   1815
  28.    End
  29.    Begin CommandButton cmdTrip 
  30.       BackColor       =   &H00000000&
  31.       Caption         =   "Go!"
  32.       Height          =   375
  33.       Left            =   120
  34.       TabIndex        =   2
  35.       Top             =   120
  36.       Width           =   495
  37.    End
  38.    Begin PictureBox picPlane 
  39.       AutoSize        =   -1  'True
  40.       ClipControls    =   0   'False
  41.       Height          =   1020
  42.       Index           =   2
  43.       Left            =   240
  44.       Picture         =   TRANSP.FRX:1A054
  45.       ScaleHeight     =   66
  46.       ScaleMode       =   3  'Pixel
  47.       ScaleWidth      =   149
  48.       TabIndex        =   1
  49.       Top             =   960
  50.       Visible         =   0   'False
  51.       Width           =   2265
  52.    End
  53.    Begin PictureBox picPlane 
  54.       AutoSize        =   -1  'True
  55.       ClipControls    =   0   'False
  56.       Height          =   1020
  57.       Index           =   1
  58.       Left            =   120
  59.       Picture         =   TRANSP.FRX:1B466
  60.       ScaleHeight     =   66
  61.       ScaleMode       =   3  'Pixel
  62.       ScaleWidth      =   149
  63.       TabIndex        =   0
  64.       Top             =   720
  65.       Visible         =   0   'False
  66.       Width           =   2265
  67.    End
  68. End
  69. Option Explicit
  70.  
  71. Sub cmdTrip_Click ()
  72. Dim iLeft As Integer
  73. Dim iTop As Integer
  74.  
  75.     Screen.MousePointer = 11
  76.     ' Make sure the picture-property contains a valid
  77.     ' bitmap-handle
  78.     picPlane(1).Picture = picPlane(1).Image
  79.     picPlane(2).Picture = picPlane(2).Image
  80.     picAngel.Picture = picAngel.Image
  81.  
  82.     ' Show persisent picture of angel in upper right corner
  83.     ' This will definitively change the bitmap, so if you like
  84.     ' to keep the original bitmap intact, keep a copy of it in
  85.     ' a picture-box
  86.  
  87.     ' Persistent pictures require AutoRedraw=TRUE
  88.     wndEarth.AutoRedraw = -1
  89.     LoadTransparantBitmap wndEarth.hDC, picAngel.Picture, 7, 72, 200
  90.     wndEarth.AutoRedraw = 0
  91.     ' Show the changed picture
  92.     wndEarth.Refresh
  93.  
  94.     ' Set bitmap of Image property a bitmap-handle
  95.     wndEarth.Picture = wndEarth.Image
  96.  
  97.     iLeft = wndEarth.ScaleWidth
  98.     iTop = 50
  99.  
  100.     Do While iTop < 450
  101.         'Fly plane left
  102.         Do While iLeft > -picPlane(1).ScaleWidth
  103.             MoveTransparantBitmap wndEarth.hDC, wndEarth.Picture, 0, 0, picPlane(1).Picture, 7, iLeft + 5, iTop, iLeft, iTop
  104.             iLeft = iLeft - 5
  105.         Loop
  106.         'Fly plane right
  107.         Do While iLeft < wndEarth.ScaleWidth
  108.             MoveTransparantBitmap wndEarth.hDC, wndEarth.Picture, 0, 0, picPlane(2).Picture, 7, iLeft - 5, iTop + 100, iLeft, iTop + 100
  109.             iLeft = iLeft + 5
  110.         Loop
  111.         iTop = iTop + 200
  112.     Loop
  113.  
  114.     ' Remove all non-persistent drawings with Load- or MoveTransparantBitmap function
  115.     ' The persistent graphics will stay on the screen
  116.     wndEarth.Refresh
  117.  
  118.     Screen.MousePointer = 0
  119. End Sub
  120.  
  121. Sub Form_Load ()
  122.     WindowState = 2
  123. End Sub
  124.  
  125.